<%-- 
    Document   : checkUserForm
    Created on : 2020-6-7, 23:29:43
    Author     : Lenovo
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="com.qdu.entity.Users"%>
<%@page import="org.apache.catalina.User"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
        <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
        <title>用户审核表</title>
     <style>
            table tr th{
                background-color: darkcyan;
                color: white;
                text-align: center;
            }
            #in{
                white-space:nowrap;
                overflow:hidden;
                text-overflow: ellipsis;
                width: 50px;
            }
        </style>
    </head>
    <body>
        <div class="container">
            <br>
            <table id="dataTable" class="table table-hover table-striped">
                <tr>
                    <th>用户编号</th>
                    <th>用户姓名</th>
                    <th>性别</th>
                    <th>生日</th>
                    <th>身份证号</th>
                    <th>邮箱</th>
                    <th>电话号码</th>
                    <th>城市</th>
                    <th>职业</th>
                    <th>审核状态</th>
                    <th>操作</th>
                </tr>
                <!--循环显示-->
                <c:forEach items="${requestScope.list}" var="l">
                     <tr id="tr${l.getUid()}">
                        <td id="no"><a href="msols?id=${l.getUid()}">${l.getUid()}</a></td>
                        <td>${l.getUname()}</td>
                        <td>${l.getUgender()}</td>
                        <td>${l.getUbrithday()}</td>
                        <td>${l.getUIDnumber()}</td>
                        <td>${l.getUemail()}</td>
                        <td>${l.getUtelnumber()}</td>
                        <td>${l.getUcity()}</td>
                        <td>${l.getUcareer()}</td>
                        <td>${l.getUstatus()}</td>
                        <td>
                            <!--点击超链接可执行js代码，需要添加前缀“javascript:”-->
                            <!--这里点击“删除”超链接调用自定义的deleteStudent()函数，传入学号删除当前学生-->
                            <!--因为学号是字符串，所以参数两端加引号（外围已经有双引号，所以用了单引号-->
                            <a href="javascript:passUser('${l.getUid()}')" id="delete">通过审核</a>
                        </td>
                    </tr>
                    </c:forEach>
            </table>
            <script>
            function passUser(id){
                 $.ajax({
                     url:"upcs",
                     type:"GET",
                     data: {userId:id},
                     success:function(){
                         $("#tr"+id).remove();
                     },
                     error:function (req, status, error) { 
                        alert("请求处理出错，错误信息：" + error);
                    }
                 }); 
            }
        </script>
    </body>
</html>
